package com.sso.oauth.controller;

import com.sso.oauth.utils.SessionHelper;
import lombok.extern.log4j.Log4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by Derry Luo on 2019/5/10.
 */
@Controller
@RequestMapping("/storefront/secure/account")
@Log4j
public class AccountController {

    @Autowired
    private SessionHelper sessionHelper;

    /**
     * 注销登录
     *
     * @return
     */
    @RequestMapping("logout")
    public String logout(HttpServletRequest servletRequest, HttpServletResponse response) throws IOException {

        sessionHelper.logout(servletRequest,response);

        return null;
    }

}
